﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AGrandVenture
{
    public class Race
    {

        private string name;
        private string description;

        private Dictionary<string, int> statModifiers;

        public string Name
        {
            get { return name; }
            set { if (!string.IsNullOrEmpty(value)) name = value; }
        }

        public string Description
        {
            get { return description; }
            set { if (!string.IsNullOrEmpty(value)) description = value; }
        }

        public Dictionary<string, int> StatModifiers
        {
            get { return statModifiers; }
            set { statModifiers = value; }
        }

        public Race()
        {
        }

        public Race(string name)
        {
            this.name = name;
        }

        #region Stat Modifiers

        public int GetStatModifier(string abbreviation)
        {
            int value = 0;

            if (statModifiers != null)
                statModifiers.TryGetValue(abbreviation, out value);

            return value;
         }

        public void AddStatModifier(string abbreviation, int value)
        {
            if (statModifiers == null)
                statModifiers = new Dictionary<string, int>();

            statModifiers.Add(abbreviation, value);
        }

        public void RemoveStatModifier(string abbreviation)
        {
            if (statModifiers == null)
                return;

            statModifiers.Remove(abbreviation);
        }

        public Dictionary<string, int> GetStatMods()
        {
            return statModifiers;
        }

        public void ClearStatMods()
        {
            statModifiers.Clear();
        }

        #endregion

    }
}
